package com.wenhai.spring.questions;

import org.springframework.beans.factory.annotation.Autowired;

public class Student {
    private Long id;
    private String name;

    @Autowired
    private ClassRoot classRoot;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ClassRoot getClassRoot() {
        return classRoot;
    }

    public void setClassRoot(ClassRoot classRoot) {
        this.classRoot = classRoot;
    }


    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", classRoot=" + (classRoot == null ? "" : classRoot.getName()) +
                '}';
    }
}
